if(!require(devtools)){install.packages("devtools")}
devtools::install_github("khufkens/ceipr")
library(ceipr)

# IMPORTANT - REPLACE THIS WITH YOUR DOWNLOAD DIR:
dir <- './downloads'

Load all data for 2016:

year <- 2016
eu_data <- ceip_read(pollutant="ALL",sector="ALL",year = year, path = dir)
# total emissions per country, adding in the population of each EU country in the corresponding year(s):
eu_totals <- ceip_add_population(ceip_totals(eu_data))
# filter out the 28 countries in the European Union:
eu28_totals <- dplyr::filter(eu_totals,eu28 == "EU")

Comparison of total emissions between countries

pollutants <- ceip_pollutant_meta_data()
pollutants %>%
  map(function(p) {
    df <- dplyr::filter(eu28_totals,pollutant == p,sector_abbr == "NT")
    ceip_compare_totals(df,subject=p)
  })

Compare emissions per pollutant per person between countries

pollutants <- ceip_pollutant_meta_data()
# add the emission per person calculation (WARNING: it also changes the unit to grams!)
eu28_pp <- ceip_population_emissions(eu28_totals)
pollutants %>%
  map(function(p) {
    df <- dplyr::filter(eu28_pp,pollutant == p,sector_abbr == "NT")
    ceip_compare_pp(df,subject=p,rank=TRUE)
  })

Industry and pollutant specific comparisons

Here we zoom in on specific "problematic" industries.

NOX and road transport

NOx_transport <- dplyr::filter(eu28_pp,pollutant == "NOx",sector_abbr == "F")
ceip_compare_pp(NOx_transport,subject="Road tranport - NOx",rank=TRUE)

CO and aviation

CO_aviation <- dplyr::filter(eu28_pp,pollutant == "CO",sector_abbr == "H")
ceip_compare_pp(CO_aviation,subject="Aviation - CO",rank=TRUE)

MAPS

NOx - transportation

NOx_transport_data <- dplyr::filter(eu_data,pollutant == "NOx",sector_abbr == "F",iso2 %in% c("BE","FR","NL","LU","GB","DE","IE"))
NOx_raster <- convert_to_raster(NOx_transport_data,trim = TRUE)
raster::plot(NOx_raster,maxpixels=624000)
CO_aviation_data <- dplyr::filter(eu_data,pollutant == "CO",sector_abbr == "I",iso2 %in% c("BE","FR","NL","LU","GB","DE","IE"))
CO_raster <- convert_to_raster(CO_aviation_data,trim = TRUE)
raster::plot(CO_raster,maxpixels=624000)
vehicle_shares <- eurostat::get_eurostat("sdg_09_50")


khufkens/ceipr documentation built on May 20, 2019, 11:58 a.m.